#ifndef  SMART_CAR_H
#define SMART_CAR_H

// #define PI 3.1415

#include "buzzer.h"
#include "motor_controller.h"
#include "supersonic.h"
#include "Arduino.h"
#include "ultrasonic.h"

class SmartCar {
public:
MotorController left;
MotorController right;
Buzzer buzzer;
SuperSonic supersonic;
UltraSonic ultrasonic;
bool flag_sonic;

float speed_left_run=85,speed_right_run=90;
float speed_left_back=85,speed_right_back=90;



    SmartCar(
        int leftMotorForwardPin,
        int leftMotorBackwardPin,
        int rightMotorForwardPin,
        int rightMotorBackwardPin,
        int buzzerPin,
        int supersonicButton,
        int supersonicRx,
        int supersonicTx,
        int supersonicRxA,
        int supersonicTxA,
        int servo,
        bool flag_sonic
    );
    void init();
    void back(float time);
    void run(float time);
    void stop(float time);
    float getObstacleDistance();
    void initspeed(float a,float b,float c,float d);
    void turnLeftBoth(float time);
    void turnRightBoth(float time);
    void turnLeftReverse(float time);
    void turnRightReverse(float time);
    void turnLeftInPlace(float time);
    void turnRightInPlace(float time);
    void backLeftInPlace(float time);
    void backRightInPlace(float time);
    void servoPulse(int myangle);
};
    
    
#endif
